#include <mutex>
using std::mutex;


template <class T>
class unique_ptr{
private:
    T* _ptr;
public:
    explicit unique_ptr(T* ptr = nullptr): _ptr(ptr){}
    ~unique_ptr(){if(ptr != nullptr) delete _ptr;}

    unique_ptr(const unique_ptr& up) = delete;
    unique_ptr(const unique_ptr&& up): _ptr(up->_ptr){up->_ptr = nullptr;}

    unique_ptr& operator=(const unique_ptr& up) = delete;
    unique_ptr& operator=(unique_ptr&& up){
        swap(up->_ptr, _ptr);
        return *this;
    }

    T& operator*(){ return *_ptr;};
    T* operator->(){ return _ptr;};
public:
    T* get();
    T* release();
    void reset();


};